package com.yyfax.pay.depository.dao;

import org.apache.ibatis.annotations.Param;

import com.yyfax.pay.depository.domain.FuiouTransferMerchantUser;

/**
 * 转账(商户与个人之间)DAO
 *
 * @author yejc
 * @date 2017-11-09
 * @since v2.0.0
 */
public interface FuiouTransferMerchantUserDao {
	/**
	 * 根据主键删除
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int deleteByPrimaryKey(String busiId);

	/**
	 * 保存实体对象
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int insert(FuiouTransferMerchantUser record);

	/**
	 * 根据主键查询
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	FuiouTransferMerchantUser selectByPrimaryKey(String busiId);

	/**
	 * 根据主键更新
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int updateByPrimaryKey(FuiouTransferMerchantUser record);

	/**
	 * 根据订单号和商户号查询
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 * @param orderId
	 * @param merchantCode
	 * @return
	 */
	FuiouTransferMerchantUser selectByOrderIdMerchantCode(@Param("orderId") String orderId, @Param("merchantCode") String merchantCode);

	/**
	 * 根据主键和状态更新状态
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 * @param oriState
	 * @param tarState
	 * @param busiId
	 * @param currentDateTime
	 * @return
	 */
	int updateStateByBusiId(@Param("oriState") String oriState, @Param("tarState") String tarState, @Param("busiId") String busiId,
							@Param("currentDateTime") String currentDateTime);

	/**
	 * 更新状态
	 * 
	 * @author heizq
	 * @date 2017-09-07 11:33:51
	 * @since v1.0.0
	 * @param newState
	 * @param busiId
	 * @param updateTime
	 * @return
	 */
	int updateStateRspByBusiId(@Param("newState") String newState, @Param("busiId") String busiId, @Param("updateTime") String updateTime,
							   @Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);
}